]> dgit.raspbian.org Git - gnome-shell.git/commit
signalTracker: Add TransientSignalHolder class
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 4 Mar 2022 22:32:24 +0000 (23:32 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 5 Mar 2022 00:12:27 +0000 (00:12 +0000)
commitcf29ec2f2231a897d25b67fac151e49da451eaeb
tree1cd5405d7b9a7744c5edffa867fcd5896ba01624
parent7b0a94b246a241d17891ab4f8a49df2072fbfc98
signalTracker: Add TransientSignalHolder class

There are cases where we want to connect to a number of signals
for the lifetime of an object, but also other signals for a
limited period (say: between show and hide).

It is currently not possible to use disconnectObject() for the
latter, because it will disconnect all signals.

To address this use case, add a small class that can be used as
a transient signal holder, while still benefiting from autocleanup
by proxying the real owner.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2221>
js/misc/signalTracker.js
tests/unit/signalTracker.js